from app import create_app, db, socketio
from models.user import User
from models.image_task import ImageTask
from models.style_template import StyleTemplate
from models.ai_config import AIConfig

app = create_app()

@app.shell_context_processor
def make_shell_context():
    return {
        'db': db,
        'User': User,
        'ImageTask': ImageTask,
        'StyleTemplate': StyleTemplate,
        'AIConfig': AIConfig
    }

if __name__ == '__main__':
    with app.app_context():
        db.create_all()
    socketio.run(app, debug=True, host='0.0.0.0', port=5000)